package org.springcloud.wisdom.spring_01_canteen.login.service;

import org.springcloud.wisdom.spring_01_canteen.login.dao.Clogindao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
//判断注册是否有重名
@Service
public class CmallServiceImpl implements CmallService {
    @Autowired
    private Clogindao clogindao;

    @Override
    public boolean checkMnameExists(String mname) {
        if (mname == null || mname.isEmpty()) {
            return false;
        }
        // 通过新的查询方法获取具有相同 mname 的记录数量
        int count = clogindao.countByMname(mname);
        return count > 0;
    }
}
